<template>
  <div id="userSearch">
    <el-row :gutter="24">
      <el-col :span="6">
        <el-input v-model="params.username" placeholder="请输入用户名" /> 
      </el-col>
      <el-col :span="6">
        <el-input v-model="params.name" placeholder="请输入姓名" /> 
      </el-col>
      <el-col :span="6">
        <el-input v-model="params.telNumber" placeholder="请输入手机号" /> 
      </el-col>
      <el-col :span="2">
        <el-button type="primary" round @click="selectUserInfo">
          <i class="iconfont icon-sousuo size" />
          查询
        </el-button>
      </el-col>
      <el-col :span="2">
        <el-button type="primary" round @click="addUser">
          <i class="iconfont icon-tianjia size" />
          新建
        </el-button>
      </el-col>
      <el-col :span="2">
        <el-button type="primary" round @click="exportUser">
          <i class="iconfont icon-daochu size" />
          导出
        </el-button>
      </el-col>
    </el-row>
  </div>
</template>

<script>

import {
  exportUserInfo
} from '@/assets/request/api.js';
export default {
  name: 'userSearch',
  data() {
    return {
      params: {
        username: '',
        name:'',
        telNumber:''
      }
    }
  },
  methods: {
    selectUserInfo() {
      this.$emit("selectUser",this.params)
    },
    addUser() {
      this.$emit('addUser')
    },
    exportUser() {
      exportUserInfo(this.params).then(res => {

        this.$message({
          message: '导出成功',
          type: 'success'
        });

      }).catch(err => {
        this.$message({
          message: '导出失败',
          type: 'error'
        });
      })
    }
  },
 
    
}
</script>

<style scoped lang="scss">

.el-input /deep/ .el-input__inner{ 
  height: 32px;
  font-size: 13px;
  box-shadow: none;
  border: 1px solid #e9e9e9;
}


.el-button {
  line-height: 0px;
  height: 32px;
  padding: 12px;
  border-radius: 20px;
  margin-left: 12px;
  .size {
    font-size: 4px;
  }
}

 
</style>
